home *** CD-ROM | disk | FTP | other *** search
- #!/usr/sbin/perl
-
- $K=1024; #1-K
- $Meg=$K*$K; #1-Meg
- $XCONFIRM='/usr/bin/X11/xconfirm';
-
- $name=$ENV{"USER"};
- $home=$ENV{"HOME"};
-
- $OLD_DISK="$home/WIN31-$name.hdf";
- $NEW_DISK="$home/WIN311-$name.hdf";
-
-
- #get free disk space on home device
- $_=`/usr/sbin/df -k $home|/bin/tail -1`;
- ($free_space)=/.{27}\s*\S+\s+\d+\s+\d+\s+(\d+).*/;
-
-
- #find size of old hard disk in K
-
- $old_size=((($old_exists=-R $OLD_DISK)?-s $OLD_DISK:0)+$K-1)/$K;
- $old_MB=int(($old_size+$K-1)/$K);
-
- if (!$old_exists) {
- #nothing to complain about
- exit 0;
- }
-
- #put up warning
-
- $prog="$XCONFIRM".' -c -B "Yes" -b "No" '.
- '-header "Delete old hard disk" '.
- "-t $OLD_DISK ".
- '-t "You still have an old hard disk that is" '.
- '-t "taking up millions and millions of" '.
- '-t "bytes ('."$old_MB".' Meg). This file is needed " '.
- '-t "if you still wish to run SoftWindows 1.X." '.
- '-t "Delete?" '.
- '-icon question -geometry "360x190"';
-
- $_=`$prog`;
-
- if (/Yes/) {
- unlink($OLD_DISK);
- }
- exit 0;
-
-